package com.thiny.android.game.thunderbolt.role;

import com.thiny.android.game.thunderbolt.util.Constants;
import com.thiny.android.game.thunderbolt.view.GameView;

/**
 * 道具类，共五种：
 * 添加生命值，
 * 添加子弹（上限为三发），
 * 大弹（威力增强），
 * 子弹加速，
 * 清除画面敌机及子弹。
 * 
 * @author THINY
 * 
 */
public class Property extends BaseRole {

	public Property(GameView gameView, float x, float y, int dir, int type,
			int speed) {
		super(gameView, x, y, dir, type, speed);

	}

	@Override
	public void setRoleBitmap(int type) {
		switch (type) {
		case Constants.ADD_LIFE:
			mRoleBitmap = mGameView.addLife;
			break;
		case Constants.ADD_BULLET:
			mRoleBitmap = mGameView.addBullet;
			break;
		case Constants.CHANGE_BULLET:
			mRoleBitmap = mGameView.changeBullet;
			break;
		case Constants.SPEED_UP:
			mRoleBitmap = mGameView.speedUp;
			break;
		case Constants.CLEAR_ALL_ENEMY:
			mRoleBitmap = mGameView.clearAllEnemy;
			break;

		}

	}

	// 道具以固定速度向下移动
	@Override
	public void move() {
		y += speed;
	}

}
